//
// Created by YeMingMing on 2024-03-05.
//

#include <stdio.h>
// 冒泡排序
void sort(int *nums, int n) {
    for (int i=0;i<n;i++) {
        for (int j=i;j<n;j++) {
            if (nums[i] > nums[j]) {
                int t = nums[i];
                nums[i] = nums[j];
                nums[j] = t;
            }
        }
    }
}


int main() {
    int nums[] = {0,7,5,6,2,1,4,8};
    sort(nums,8);
    for (int i=0; i< 8;++i) {
        printf("%d ",nums[i]);
    }

    return  0;
}
